<?php
	include 'config.php';
	include 'includes/user.class.php';
	$isloggedin = CheckLogin($mysql);
	$perms = CheckPermissions($mysql);
	
	include 'includes/blog.php';
	$blog = new Blog();
	$sectiontitle = "<a href=\".\">Overview</a>";
	$pagetitle = "Overview";
	
		if(!empty($_GET['b'])){
			$b = strip_tags($_GET['b']);
			$content = $blog->Read($mysql,$b);
			$title = $content[0];
			$content = PrepareContent($content[1]);
			$sectiontitle = "<a href=\".\">Overview</a> &rarr; <a href=\"index.php?b=$b\">$title</a>";
			$pagetitle = $title;
		}elseif(!empty($_GET['bp'])){
			$bp = strip_tags($_GET['bp']);
			$content = stripBBCode($blog->PostList($mysql,5,$bp));
		}else{
			$content = stripBBCode($blog->PostList($mysql,5,0));
		}
		
	include $user_style.'index.php';
?>